<template>
  <div class="header">
     <div class="right" @click="getUserInfo()"><span class="iconfont"><img src="../../../assets/userIcon/userIcon.png" alt=""></span></div>
     <div class="input" @click="getinCity()"><div  ><span class="iconfont">&#xe62d;</span>输入您想前往的城市</div></div>
     <div class="left" @click="getinCity()"><span class="arrow-text">{{this.city}}</span><span class="iconfont arrow-icon">&#xeb6d;</span></div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  name: 'Header',
  methods: {
    getinCity () {
      this.$router.push({
        path: '/city'
      })
    },
    getUserInfo () {
      this.$router.push({
        path: '/userIfno'
      })
    }
  },
  computed: {
    ...mapState(['city'])
  }

}
</script>
<style lang="stylus" scoped>
  @import '~assets/variles.styl'
  .header
    display: flex
    background: $bgColor
    line-height:$headerHeight
    color: #fff
    .left
      min-width:1.04rem
      padding: 0 .1rem
      float: right
      text-align: center
      .arrow-icon
        font-size: .24rem
    .right
      width:.84rem
      float: left
      text-align: center
      img
        width: 65%
    .input
      padding-left: .2rem
      flex: 1
      color: #ccc
      background: #fff
      border-radius: .1rem
      line-height: .64rem
      margin-top: .12rem
      height: .64rem
</style>
